Skip to content

Conversation

@aasitvora99
Copy link
Contributor

@aasitvora99 aasitvora99 commented Oct 11, 2025

Some fields from encoding was causing issues in the _Flight__evaluate_post_process() method. Made a small hotfix for now to remove the bad actors that could not be converted.

2025-10-11 12:01:15,663 - ERROR - get_flight_simulation: Unexpected error 'numpy.ndarray' object is not callable
Traceback (most recent call last):
  File "/Users/aasitvora/Desktop/chintu/Infinity-API/src/controllers/interface.py", line 16, in wrapper
    return await method(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/aasitvora/Desktop/chintu/Infinity-API/src/controllers/flight.py", line 108, in get_flight_simulation
    return flight_service.get_flight_simulation()
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/Users/aasitvora/Desktop/chintu/Infinity-API/src/services/flight.py", line 61, in get_flight_simulation
    encoded_attributes = collect_attributes(
        self.flight,
    ...<5 lines>...
        ],
    )
  File "/Users/aasitvora/Desktop/chintu/Infinity-API/src/utils.py", line 121, in collect_attributes
    attributes = rocketpy_encoder(obj)
  File "/Users/aasitvora/Desktop/chintu/Infinity-API/src/utils.py", line 105, in rocketpy_encoder
    json_str = json.dumps(
        obj,
    ...<4 lines>...
        allow_pickle=False,
    )
  File "/usr/local/Cellar/[email protected]/3.13.5/Frameworks/Python.framework/Versions/3.13/lib/python3.13/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
          ~~~~~~^^^^^
  File "/usr/local/Cellar/[email protected]/3.13.5/Frameworks/Python.framework/Versions/3.13/lib/python3.13/json/encoder.py", line 200, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/local/Cellar/[email protected]/3.13.5/Frameworks/Python.framework/Versions/3.13/lib/python3.13/json/encoder.py", line 261, in iterencode
    return _iterencode(o, 0)
  File "/Users/aasitvora/Desktop/chintu/Infinity-API/src/utils.py", line 76, in default
    obj._Flight__evaluate_post_process()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
TypeError: 'numpy.ndarray' object is not callable

Summary by CodeRabbit

  • New Features

    • Edits to flights, motors, and rockets now allow null values to be sent, enabling fields to be cleared during updates.
  • Bug Fixes

    • Serialization/export behavior changed: a post-processing step is no longer executed during encoding, which may alter exported flight data and affect downstream reliability.
  • Chores

    • Environment simulation accepts fractional heights (broader height type for max expected height).
    • Updated a dependency source used by the project.

@aasitvora99 aasitvora99 self-assigned this Oct 11, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 11, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Three repository update methods were changed to include None-valued fields in serialized payloads; InfinityEncoder gained an init, had its default parameter renamed, and no longer invokes Flight post-processing; EnvironmentSimulation.max_expected_height type widened to float; RocketPy dependency switched to a git-based develop branch.

Changes

Cohort / File(s) Summary
Repository update payloads
src/repositories/flight.py, src/repositories/motor.py, src/repositories/rocket.py
Replaced model_dump(..., exclude_none=True) with model_dump(..., exclude_none=False) in update_*_by_id methods so None-valued fields are included in update payloads; method signatures unchanged.
InfinityEncoder adjustments
src/utils.py
Added def __init__(self, *args, **kwargs); renamed default(self, o)default(self, obj); replaced call obj._Flight__evaluate_post_process() with attribute access obj._Flight__evaluate_post_process (post-process no longer invoked during encoding).
Type annotation change
src/views/environment.py
Changed EnvironmentSimulation.max_expected_height annotation from Optional[int] to Optional[float].
Dependency source change
requirements.txt
Replaced PyPI rocketpy entry with git+https://github.com/RocketPy-Team/RocketPy.git@develop, switching the RocketPy source to the repository's develop branch.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Client
  participant Repo as Repository
  participant Model as PydanticModel
  Client->>Repo: update_*_by_id(id, payload_model)
  Repo->>Model: payload_model.model_dump(exclude_none=False)
  note right of Repo #E8F0FF: serialized payload now includes None fields
  Repo->>Repo: update_by_id(id, serialized_payload)
  Repo-->>Client: update result
Loading
sequenceDiagram
  autonumber
  participant Caller
  participant Enc as InfinityEncoder
  participant Flight
  participant Parent as JSONEncoder

  Caller->>Enc: encode(obj: Flight)
  Enc->>Flight: access obj._Flight__evaluate_post_process
  note right of Enc #E8F0FF: attribute read only — post-process not invoked
  alt Flight handled
    Enc->>Flight: read fields (including None)
    Enc-->>Caller: serialized JSON
  else fallback
    Enc->>Parent: parent.default(obj)
    Parent-->>Enc: fallback result
    Enc-->>Caller: serialized JSON
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Points to check during review:

  • Verify intentionality of including None in update payloads and potential DB/patch semantics in update_by_id (files in src/repositories/*).
  • Confirm the removal of the post-process invocation in InfinityEncoder.default (src/utils.py) — ensure no required side effects are lost.
  • Validate tests or serialization expectations after changing EnvironmentSimulation.max_expected_height type and the RocketPy dependency source (src/views/environment.py, requirements.txt).

Possibly related PRs

Suggested reviewers

  • phmbressan
  • Gui-FernandesBR
  • luimot

Poem

I nudge the payloads, let the Nones slip in,
I peek at a private thing — I do not call, just grin.
A rabbit hops through bytes and tweaks a tiny thread,
Fields now show their emptiness where once they stayed unread.
Tail twitch, soft code-hop, changes tucked in bed. 🐇

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "BUG: issues with encoding and null field updates" accurately relates to the main changes in the changeset. The title references two significant areas being modified: encoding issues (addressed in src/utils.py by removing the problematic call to _Flight__evaluate_post_process()) and null field updates (addressed across flight.py, motor.py, and rocket.py by changing exclude_none=True to exclude_none=False). The title is clear, specific enough for a teammate scanning history to understand that this fixes bugs related to encoding and null handling, and directly connects to the primary changes without being misleading or off-topic.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bug/simulate-forward-fixes

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 476f88b and 82d55e6.

📒 Files selected for processing (1)
  • requirements.txt (1 hunks)
🔇 Additional comments (1)
requirements.txt (1)

12-12: Document the intent and timeline for this git-based dependency; consider pinning to a specific commit hash.

The change to git+https://github.com/RocketPy-Team/RocketPy.git@develop is confirmed in the codebase (git log: "chore: updating branch of rocketpy to dev"), indicating this was deliberate. However, it lacks critical documentation:

  • No commit hash pinning: Without a specific commit, builds are non-deterministic across time and environments, violating reproducibility principles.
  • No timeline: It's unclear whether this is temporary pending a stable RocketPy release or permanent.
  • No tracking issue: There's no reference to which RocketPy issue this addresses or when it may be resolved.

Web search found no recent stable RocketPy release addressing numpy/JSON serialization issues, so reverting to PyPI immediately may not be feasible.

Immediate steps:

  1. Pin to a specific commit hash: git+https://github.com/RocketPy-Team/RocketPy.git@<commit_hash> (replaces the floating @develop reference).
  2. Document the intent, tracked issue/PR, and planned timeline in a code comment or tracking issue.
  3. Create a follow-up issue to revert to PyPI once RocketPy publishes a stable release with the necessary fix.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (2)
src/repositories/motor.py (1)

29-32: Same concern as in flight.py: verify None-value handling.

This change mirrors the one in src/repositories/flight.py. Ensure that including None-valued fields in the update payload aligns with the intended update semantics and doesn't cause unintended data overwrites.

src/repositories/rocket.py (1)

29-32: Same concern as in flight.py: verify None-value handling.

This change mirrors the one in src/repositories/flight.py. Ensure that including None-valued fields in the update payload aligns with the intended update semantics and doesn't cause unintended data overwrites.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 971f7ac and 44a2ebc.

📒 Files selected for processing (4)
  • src/repositories/flight.py (1 hunks)
  • src/repositories/motor.py (1 hunks)
  • src/repositories/rocket.py (1 hunks)
  • src/utils.py (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
src/repositories/rocket.py (6)
src/models/rocket.py (3)
  • UPDATED (41-42)
  • RocketModel (13-63)
  • DELETED (45-46)
src/routes/rocket.py (1)
  • update_rocket (56-68)
tests/unit/test_routes/test_rockets_route.py (1)
  • test_update_rocket (357-365)
src/controllers/flight.py (1)
  • update_rocket_by_flight_id (47-66)
src/routes/flight.py (1)
  • update_flight_rocket (140-155)
tests/unit/test_routes/test_flights_route.py (1)
  • test_update_rocket_by_flight_id (190-199)
src/repositories/flight.py (3)
src/routes/flight.py (1)
  • update_flight (58-70)
tests/unit/test_routes/test_flights_route.py (5)
  • test_update_flight_invalid_input (212-216)
  • test_update_environment_by_flight_id (176-187)
  • test_update_flight_by_id (166-173)
  • test_update_rocket_by_flight_id (190-199)
  • test_update_flight_not_found (219-225)
src/controllers/flight.py (2)
  • update_rocket_by_flight_id (47-66)
  • update_environment_by_flight_id (25-44)
src/repositories/motor.py (3)
src/routes/motor.py (1)
  • update_motor (56-68)
src/views/motor.py (2)
  • MotorView (76-77)
  • MotorSimulation (7-73)
tests/unit/test_routes/test_motors_route.py (3)
  • test_update_motor (291-298)
  • test_update_motor_not_found (308-316)
  • test_update_motor_invalid_input (301-305)
src/utils.py (1)
src/views/flight.py (1)
  • FlightSimulation (9-140)
🪛 GitHub Actions: Pylint
src/utils.py

[error] 78-78: pylint: C0303 trailing whitespace detected.


[error] 83-83: pylint: C0303 trailing whitespace detected.


[error] 89-89: pylint: C0303 trailing whitespace detected.


[error] 92-92: pylint: C0303 trailing whitespace detected.


[error] 95-95: pylint: C0303 trailing whitespace detected.


[error] 98-98: pylint: W0612 Unused variable 'e' (unused-variable).

🪛 Ruff (0.13.3)
src/utils.py

87-87: Do not catch blind exception: Exception

(BLE001)


88-88: Use logging.exception instead of logging.error

Replace with exception

(TRY400)


94-94: Use logging.exception instead of logging.error

Replace with exception

(TRY400)


98-98: Do not catch blind exception: Exception

(BLE001)


98-98: Local variable e is assigned to but never used

Remove assignment to unused variable e

(F841)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses encoding issues and null field update problems in the flight simulation system. The main issue was that the _Flight__evaluate_post_process() method was corrupted as a numpy array instead of a callable method, causing encoding failures.

  • Added robust error handling and corruption detection for the _Flight__evaluate_post_process method in the JSON encoder
  • Changed repository update methods to include null fields instead of excluding them
  • Implemented fallback mechanisms for encoding errors

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/utils.py Added comprehensive error handling and corruption detection for Flight object encoding
src/repositories/rocket.py Changed model dump to include null fields during updates
src/repositories/motor.py Changed model dump to include null fields during updates
src/repositories/flight.py Changed model dump to include null fields during updates

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

src/utils.py Outdated
try:
delattr(obj, '_Flight__evaluate_post_process')

restored_method = getattr(obj, '_Flight__evaluate_post_process', None)
Copy link

Copilot AI Oct 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After deleting the corrupted attribute, immediately accessing it again may not restore the original method. The cached_property mechanism might not automatically recreate the method. Consider using the class definition to access the original property descriptor.

Suggested change
restored_method = getattr(obj, '_Flight__evaluate_post_process', None)
# Access the property via the class descriptor to restore it correctly
restored_method = type(obj)._Flight__evaluate_post_process.__get__(obj, type(obj))

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wdyt @aasitvora99 ?

GabrielBarberini and others added 2 commits October 11, 2025 16:27
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Collaborator

@GabrielBarberini GabrielBarberini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments, also could you please fix the linter issues ?

src/utils.py Outdated
delattr(obj, '_Flight__evaluate_post_process')

restored_method = getattr(obj, '_Flight__evaluate_post_process', None)
if restored_method and callable(restored_method):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arguably this is a tautology.

If it is callable it will always pass the first check.

Maybe just reduce it to if callable(obj)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted my changes back to normal, unblocked by bressan on call.

src/utils.py Outdated
except Exception as fix_error:
logger.error(f"Error fixing _Flight__evaluate_post_process: {fix_error}")

elif evaluate_post_process is not None and callable(evaluate_post_process):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Only callable check is enough

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted my changes back to normal, unblocked by bressan on call.

src/utils.py Outdated
try:
delattr(obj, '_Flight__evaluate_post_process')

restored_method = getattr(obj, '_Flight__evaluate_post_process', None)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wdyt @aasitvora99 ?

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44a2ebc and 9114d81.

📒 Files selected for processing (1)
  • src/utils.py (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/utils.py (2)
src/views/flight.py (1)
  • FlightSimulation (9-140)
src/controllers/flight.py (1)
  • FlightController (12-108)
🪛 GitHub Actions: Pylint
src/utils.py

[error] 78-78: E0001: Parsing failed: 'expected an indented block after 'try' statement on line 77 (src.utils, line 78)'

🪛 Ruff (0.13.3)
src/utils.py

77-78: Expected an indented block after try statement

(invalid-syntax)


78-78: Expected except or finally after try block

(invalid-syntax)


79-79: Unexpected indentation

(invalid-syntax)


82-82: Unexpected indentation

(invalid-syntax)


89-89: Expected except or finally after try block

(invalid-syntax)


89-89: Expected an identifier, but found a keyword 'except' that cannot be used here

(invalid-syntax)


89-89: Simple statements must be separated by newlines or semicolons

(invalid-syntax)


89-89: Expected a statement

(invalid-syntax)


89-90: Expected an expression

(invalid-syntax)


91-91: Unexpected indentation

(invalid-syntax)


91-91: Expected a statement

(invalid-syntax)


91-91: Expected a statement

(invalid-syntax)


91-92: Expected an expression

(invalid-syntax)


92-92: Unexpected indentation

(invalid-syntax)


94-94: unindent does not match any outer indentation level

(invalid-syntax)


94-94: Invalid annotated assignment target

(invalid-syntax)


94-95: Expected an expression

(invalid-syntax)


95-95: Unexpected indentation

(invalid-syntax)


97-97: unindent does not match any outer indentation level

(invalid-syntax)


97-97: Expected a statement

(invalid-syntax)


97-97: Expected a statement

(invalid-syntax)


97-98: Expected an expression

(invalid-syntax)


99-99: Unexpected indentation

(invalid-syntax)


100-100: unindent does not match any outer indentation level

(invalid-syntax)


102-102: unindent does not match any outer indentation level

(invalid-syntax)


102-102: Expected a statement

(invalid-syntax)


102-102: Only single target (not tuple) can be annotated

(invalid-syntax)


102-103: Expected an expression

(invalid-syntax)


103-103: Unexpected indentation

(invalid-syntax)

🔇 Additional comments (1)
src/utils.py (1)

100-104: Verify the indentation and control flow for solution handling.

After fixing the indentation issues, ensure that lines 100-103 (the try-except block for solution retrieval) are properly indented within the if isinstance(obj, Flight): block. The early return on line 103 should prevent reaching line 104 when the exception occurs, but the current broken indentation makes this unclear.

As noted in previous comments, if the fallback on line 103 executes, solution will be undefined. However, the early return should prevent reaching line 104. Confirm the intended control flow once indentation is corrected.

GabrielBarberini and others added 6 commits October 11, 2025 16:34
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…/Infinity-API into bug/simulate-forward-fixes
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/utils.py (1)

57-58: Remove unnecessary __init__ override.

The __init__ method only delegates to the parent class without adding any custom initialization. Python automatically calls the parent's __init__ when not overridden, making this override redundant.

Apply this diff to remove the unnecessary override:

-    def __init__(self, *args, **kwargs):
-        super().__init__(*args, **kwargs)
-
     def default(self, obj):
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ec9a552 and 0286681.

📒 Files selected for processing (1)
  • src/utils.py (2 hunks)
🧰 Additional context used
🪛 GitHub Actions: Pylint
src/utils.py

[error] 60-60: Pylint: W0237 - Parameter 'o' has been renamed to 'obj' in overriding InfinityEncoder.default method (arguments-renamed).


[error] 78-78: Pylint: W0104 - Statement seems to have no effect (pointless-statement).

🪛 Ruff (0.13.3)
src/utils.py

78-78: Found useless expression. Either assign it to a variable or remove it.

(B018)

🔇 Additional comments (2)
src/utils.py (2)

60-60: Parameter rename improves clarity.

Renaming the parameter from o to obj is more descriptive and consistent with the method body. The Pylint warning (W0237) about parameter renaming in an overriding method is expected and acceptable here.


78-78: Clarify intent of private attribute access on Flight
The expression obj._Flight__evaluate_post_process merely reads a name-mangled member without calling or using it. Confirm whether this is meant to trigger a cached evaluation (and exists on the external Flight class), document that side effect, handle corruption, or remove it:

  • Document as # Access cached_property to trigger evaluation before serialization
  • Or detect/log corruption: check if it’s an np.ndarray and warn
  • Or remove the line if it serves no purpose

@aasitvora99
Copy link
Contributor Author

aasitvora99 commented Oct 25, 2025

@GabrielBarberini ran lint, format and tests

make lint
flake8 --ignore E501,E402,F401,W503,C0414 ./src || true
flake8 --ignore E501,E402,F401,W503,C0414 ./tests || true
pylint ./src || true
************* Module src.utils
src/utils.py:57:4: W0246: Useless parent or super() delegation in method '__init__' (useless-parent-delegation)
src/utils.py:60:4: W0237: Parameter 'o' has been renamed to 'obj' in overriding 'InfinityEncoder.default' method (arguments-renamed)
src/utils.py:78:12: W0104: Statement seems to have no effect (pointless-statement)

-----------------------------------
Your code has been rated at 9.95/10

pylint ./tests || true

------------------------------------
Your code has been rated at 10.00/10
make format
black ./src || true
All done! ✨ 🍰 ✨
38 files left unchanged.
black ./tests || true
All done! ✨ 🍰 ✨
7 files left unchanged.
ruff check --fix ./src || true
All checks passed!
ruff check --fix ./tests || true
All checks passed!
python3 -m pytest .
======================================================================================== test session starts ========================================================================================
platform darwin -- Python 3.13.5, pytest-8.4.1, pluggy-1.6.0
rootdir: /Users/aasitvora/Desktop/chintu/Infinity-API
configfile: pyproject.toml
plugins: anyio-4.9.0, asyncio-1.1.0
asyncio: mode=Mode.STRICT, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collected 126 items                                                                                                                                                                                 

tests/unit/test_controllers/test_controller_interface.py ............                                                                                                                         [  9%]
tests/unit/test_repositories/test_repository_interface.py ...............                                                                                                                     [ 21%]
tests/unit/test_routes/test_environments_route.py ...................                                                                                                                         [ 36%]
tests/unit/test_routes/test_flights_route.py ...........................                                                                                                                      [ 57%]
tests/unit/test_routes/test_motors_route.py ...........................                                                                                                                       [ 79%]
tests/unit/test_routes/test_rockets_route.py ..........................                                                                                                                       [100%]

======================================================================================== 126 passed in 4.04s ========================================================================================

gunicorn
uvicorn
rocketpy
git+https://github.com/RocketPy-Team/RocketPy.git@develop
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so we'll pin to rocketpy develop branch from now on ?

async def update_motor_by_id(self, motor_id: str, motor: MotorModel):
await self.update_by_id(
motor.model_dump(exclude_none=True), data_id=motor_id
motor.model_dump(exclude_none=False), data_id=motor_id
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

)
if isinstance(obj, Flight):
obj._Flight__evaluate_post_process()
obj._Flight__evaluate_post_process
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to evaluate post process?

@GabrielBarberini
Copy link
Collaborator

@GabrielBarberini ran lint, format and tests

make lint
flake8 --ignore E501,E402,F401,W503,C0414 ./src || true
flake8 --ignore E501,E402,F401,W503,C0414 ./tests || true
pylint ./src || true
************* Module src.utils
src/utils.py:57:4: W0246: Useless parent or super() delegation in method '__init__' (useless-parent-delegation)
src/utils.py:60:4: W0237: Parameter 'o' has been renamed to 'obj' in overriding 'InfinityEncoder.default' method (arguments-renamed)
src/utils.py:78:12: W0104: Statement seems to have no effect (pointless-statement)

-----------------------------------
Your code has been rated at 9.95/10

pylint ./tests || true

------------------------------------
Your code has been rated at 10.00/10
make format
black ./src || true
All done! ✨ 🍰 ✨
38 files left unchanged.
black ./tests || true
All done! ✨ 🍰 ✨
7 files left unchanged.
ruff check --fix ./src || true
All checks passed!
ruff check --fix ./tests || true
All checks passed!
python3 -m pytest .
======================================================================================== test session starts ========================================================================================
platform darwin -- Python 3.13.5, pytest-8.4.1, pluggy-1.6.0
rootdir: /Users/aasitvora/Desktop/chintu/Infinity-API
configfile: pyproject.toml
plugins: anyio-4.9.0, asyncio-1.1.0
asyncio: mode=Mode.STRICT, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collected 126 items                                                                                                                                                                                 

tests/unit/test_controllers/test_controller_interface.py ............                                                                                                                         [  9%]
tests/unit/test_repositories/test_repository_interface.py ...............                                                                                                                     [ 21%]
tests/unit/test_routes/test_environments_route.py ...................                                                                                                                         [ 36%]
tests/unit/test_routes/test_flights_route.py ...........................                                                                                                                      [ 57%]
tests/unit/test_routes/test_motors_route.py ...........................                                                                                                                       [ 79%]
tests/unit/test_routes/test_rockets_route.py ..........................                                                                                                                       [100%]

======================================================================================== 126 passed in 4.04s ========================================================================================

Linter is still failing, we need to either argue around dismissing this formally under the pyproject toml or inline (prferred) with a reasonable excuse or fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants